package com.ruipeng.controllers;

import com.ruipeng.domain.models.model.User;
import com.ruipeng.domain.models.vo.RespBody;
import com.ruipeng.domain.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by tu_pei on 2017/7/3.
 */
@RestController
@RequestMapping("/users")
@Api("用户模块相关")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/{userId}",method = RequestMethod.GET)
    @ResponseBody
    public RespBody getUserInfo(@PathVariable Integer userId){
        RespBody body = new RespBody();
        User user = new User();
        user.setUserId(userId);
        User userInfo = userService.getUserInfoByUserId(user);

        body.setCode("10000");
        body.setObj(userInfo);
        return body;
    }

}
